var $ = require('../../common/helper.js');
Page({
	data: {
		data: [],
		list: [],
		selected: 0
	},
	onLoad: function (options) {
		var _this = this;
		$.get('api.php?app=member&act=order_history', function (json) {
			_this.setData({
				data: json.data,
				list: json.data[0]
			});
		});
	},
	select: function (e) {
		var index = e.currentTarget.dataset.index;
		this.setData({
			list: this.data.data[index],
			selected: index
		});
	}
})